package com.direct.service.impl;

import java.sql.SQLException;
import java.util.List;

import com.direct.dao.DistributionDao;
import com.direct.domian.Distribution;
import com.direct.service.DistributionService;

public class DistributionServiceImpl implements DistributionService {

	private DistributionDao distributionDao;
	public void setDistributionDao(DistributionDao distributionDao) {
		this.distributionDao = distributionDao;
	}

	@Override
	public List<Distribution> list() throws SQLException {
		String hql="from Distribution d";
		List<Distribution> dis=distributionDao.queryList(hql, null);
		System.out.println("service"+dis.toString());
		return dis;
		
	}
	@Override
	public long count() throws SQLException {
		String hql="Distribution";
		Long l=distributionDao.queryCount(hql, null);
		System.out.println("service条数"+l);
		return l;
	}
	

}
